package com.eddie.strategy.improve;

/**
 * @author Eddie
 * @date 2022/08/08 14:47
 **/
public class Client {
    public static void main(String[] args) {
        WildDuck wildDuck = new WildDuck();
        wildDuck.fly();
        ToyDuck toyDuck = new ToyDuck();
        toyDuck.fly();

        PeKingDuck peKingDuck = new PeKingDuck();
        peKingDuck.fly();

        //动态改变某个对象的行为，北京鸭不能飞
        peKingDuck.setFlyBehavior(new NoFlyBehavior());
        peKingDuck.fly();
    }
}
